package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

/**
 * 采购实体类
 */
@TableName("t_procurement")
public class ProcurementBean {
    /**
     * 采购ID
     */
    @TableId(value = "pk_procurementId", type = IdType.AUTO)
    private Integer id;
    /**
     * 供应商
     */
    @TableField("p_supplier")
    private String supplier;
    /**
     * 采购员
     */
    @TableField("p_buyer")
    private String buyer;
    /**
     * 采购时间
     */
    @TableField("p_buyDate")
    private LocalDate buyDate = LocalDate.now();
    /**
     * 采购明细集合
     */
    @TableField(exist = false)
    private List<ProcurementInfoBean> infoList;

    public ProcurementBean(String supplier, String buyer) {
        this.supplier = supplier;
        this.buyer = buyer;
    }

    public ProcurementBean() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    public String getBuyer() {
        return buyer;
    }

    public void setBuyer(String buyer) {
        this.buyer = buyer;
    }

    public LocalDate getBuyDate() {
        return buyDate;
    }

    public void setBuyDate(LocalDate buyDate) {
        this.buyDate = buyDate;
    }

    public List<ProcurementInfoBean> getInfoList() {
        return infoList;
    }

    public void setInfoList(List<ProcurementInfoBean> infoList) {
        this.infoList = infoList;
    }

    @Override
    public String toString() {
        return "ProcurementBean{" +
                "id=" + id +
                ", supplier='" + supplier + '\'' +
                ", buyer='" + buyer + '\'' +
                ", buyDate=" + buyDate +
                ", infoList=" + infoList +
                '}';
    }
}
